package com.atguigu.gulimall.order.intercept;

import com.atguigu.gulimall.order.utils.HttpRequestUtils;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * @Description
 * @Author lhj
 * @Date 2024/5/2 10:00
 */
@Component
public class OrderRequestInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        HttpServletRequest request = HttpRequestUtils.httpServletRequest();
        String val = request.getHeader("Cookie");
        requestTemplate.header("Cookie", val);
    }
}
